/*
 * @Description: vue project config for cli3
 * @Author: bayesba
 * @Date: 2019-02-13 14:07:26
 * @LastEditTime: 2019-07-19 14:32:08
 * @LastEditors: Please set LastEditors
 */

module.exports = {
  // chainWebpack:  config => {
  //   config
  //   .entry('index')
  //     .add('babel-polyfill')
  // },
  devServer: {
    open: false,
    host: '0.0.0.0',
    port: 8088,
    https: false,
    hotOnly: false,
    proxy: {
      '/api': {
        target: 'http://47.93.35.179:8070',
        // target: 'http://121.37.161.44:30090',
        ws: true,
        changeOrigin: true
      },
      '/file': {
        target: 'http://47.93.35.179:8070',
        // target: 'http://121.37.161.44:30090',
        ws: true,
        changeOrigin: true
      }
    }
  },
  productionSourceMap: false,
  configureWebpack: {
    devtool: 'source-map'
  },
  // css 相关选项, 加载全局scss属性，就不用再style中单独引入了
  css: {
    /* 为预处理器 loader 传递自定义选项 */
    loaderOptions: {
      sass: {
        data: `@import "./src/styles/index.scss";`
      }
    }
  }
}
